home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / cmdlg7.zip / README.1ST < prev    next >
Text File  |  1992-12-10  |  5KB  |  129 lines

  1. Programs and units by
  2.     Juancarlo A#ez
  3.     [73000,1064]
  4.      \\\
  5.     -(j)
  6.       /juanca
  7.  
  8. This is an BP7 compatible update of the previos upload.  The only changes made were:
  9.  
  10.      a) Renaming de OWL units to the new BP7 names.
  11.      b) Use of the "inherited" keyword.
  12.  
  13. Caveat:  The new BP7 OPrinter unit is not used in this sample program.
  14. Caveat:  I've noticed the program hanging on PrinterSetup when BPW is
  15.      also running.  Why? I dunno!  But I would blame BP7 for not
  16.          handling Windows printers correctly.
  17.  
  18. CONTENTS
  19.    0///INTRO
  20.    1///WHAT IT'S ABOUT
  21.    2///HOW IT WORKS
  22.    3///LIMITATIONS
  23.    4///BUGS
  24.    5///CAVEATS&TECHNIQUES
  25.  
  26. This code intended for any use, completely free.  Allthough I will denay
  27. any responsability on any harm you cause with it<s>.  There ar no warranties
  28. expressed or implied.
  29.  
  30. But if you like it...please PAY FORWARD.
  31.  
  32. 1/////WHAT IT'S ABOUT
  33.  
  34. This units show how to build a tDialog descendant shell arround CommonDialogs
  35. so you can, frinstance, use BWCC styles or add your own controls for 
  36. app specific options.  There's also a Windows 3.1 complying tPrinter OBJECT in
  37. the PRN31_ UNIT. It is based on PRINTER.ZIP in BPROGA Lib 8 and my own code.  
  38. The main difference lies in that PRN31_ takes a tUsrWin descendant instead
  39. of a tPrintable for printing.  tUsrWins know how to print themselves (at least
  40. in what you see on screen, but with several limitations).  CAVEAT EMPTOR 
  41. WYSIWIG is up to you.
  42.  
  43. UNITS
  44.  
  45. USRWIN_.PAS   This unit defines tUsrWin, a tWindow descendant that makes 
  46.           painting easier, and is capable of printing itself.
  47.  
  48. PORT_.PAS     Defines tPort, a shell around HDC's (GDI Device Contexts).  
  49.           There are some basic methods there to ease your work.  Also,
  50.               tPrinter descends from this object, making it nearly the same
  51.               for tUsrWin to paint or print.
  52.  
  53. PRN31_.PAS    This unit defines the new tPrinter object, that knows about
  54.               tUsrWins and how to tell them to print themselves.
  55.  
  56. COMONDLG.PAS  Unit defining the tCommonDlg basic object descendand of tDialog.
  57.           Do take a look at it!
  58.  
  59. FNAMEDLG.PAS  Unit defining the tFileNameDlg object, descendand of tCommonDlg.
  60.           This object handles Open and SaveAs dialogs, trough a boolean
  61.           variable.
  62.  
  63. PRINTDLG.PAS  This unit contains the dialog deffinitions that shell the 
  64.               Common Dialog PRINT and PRINTER SETUP dialogs.
  65.  
  66. COMOSAMP.PAS  This is the main program.  It is a modification of the 
  67.               COMMDLG.PAS sample program that comes with TPW 1.5.
  68.  
  69. MY......PAS   Theese are units that show how to override the basic 
  70.               common dialog objects, to get them to do what you want.
  71.               (frinstance, set your own file Spec and Extension in a
  72.                FileOpen or FileSaveAs dialog).
  73.  
  74. 2///HOW IT WORKS
  75.  
  76. Compile and run with COMOSAMP as the main program.  Things will show up just
  77. as in the TPW1.5 example.  Choose "Use BWCC" from the File menu and try again
  78. to see things rolling.
  79.  
  80. Take a special look at the File/Open dialog to get a hint of the usefullness
  81. of the tCommonDlg objects.
  82.  
  83. 3/////LIMITATIONS
  84.  
  85. I diddn't have time to build the to build tChooseFontDlg and tChooseColorDlg
  86. but the technique is the same as for tFileNameDlg and the printer dialogs, so
  87. it should be easy if you need them.
  88.  
  89. Neither had time to get onto the ChooseColor dialog, so you'll see it just
  90. as Microsoft intendet to.
  91.  
  92. 4///BUGS
  93.  
  94. I couldn't make the BWCC-style ChooseFont dialog show the font sample.  Mabe
  95. some incompatibility with BWCC.  If you work this out, please let me know.
  96. Better, let us ALL know!.  (Same problem should show up with ChooseColor)
  97.  
  98. 5///CAVEATS&TECHNIQUES
  99.  
  100. The whole trick is placing a dialog name in the lpTemplateName of the 
  101. TOPENFILE, TPRINTDLG, etc.  structures.  This makes YOUR dialogs show up
  102. instead of Microsoft's.  You also have to use the xx_EnableTemplateName in
  103. the flags field.  The printer dialogs are a bit more tricky, so take a closer
  104. look at them.
  105.  
  106. The way to build your *common* dialogs is to steal them from the COMMONDLG.DLL
  107. in the WINDOWS\SYSTEM directory.  You do this by launching two copies of
  108. ResourceWorkshop.  One holds COMMONDLG.DLL resources and the other your own.
  109. Then you just CUT (from DLL) and PASTE (into yours). Easy!
  110.  
  111. CAVEAT:  Don't change control ID's or use near-numbered ID's for your new
  112. controls.  Number your controls in another range.  CommonDlg controls are
  113. arround 1000 to 1100, choose 7000... for yours.  Don't delete controls either.
  114. Place controls outside of the dialog window if you don't want them.
  115.  
  116. CAVEAT: I think there's a technique for making *additional* buttons, such as
  117. SETUP in PrintDlg and HELP in all, show as BWCC bitmapped...but I think it's
  118. not *legal* (and it's not debugged) so I'd like to discuss it in the forum
  119. first.
  120.  
  121. Greetings,
  122.  
  123.  \\\
  124. -(j)-
  125.   /juanca
  126.  
  127. and PAY FORWARD
  128.  
  129.